-- msg_finish_instance
-- Create by panyl
-- 通知通过了某个副本

return function(lpc)
    local data = lpc.data
    local finishedInstance = ME.user.dbase:query("finishedInstance", {})
    
    _G.currInstance = nil
    
    for index, info in pairs(data) do
        local bonus = {}
        for key, amount in pairs(info.bonus) do
            if type(key) == "number" then
                -- 物品
                table.insert(bonus, {1, key, amount})
            elseif type(key) == "string" then
                -- 属性
                table.insert(bonus, {2, key, amount})
            end
        end
        finishedInstance[index + 1] = info
        finishedInstance[index + 1].bonus = bonus
    end
    
    ME.user.dbase:set("finishedInstance", finishedInstance)
end
